package com.xique.park.api;

import com.xique.common.core.constant.ServiceNameConstants;
import com.xique.common.core.domain.R;
import com.xique.park.api.dto.AppLoginBodyDTO;
import com.xique.park.api.factory.RemoteParkWxLoginFallbackFactory;
import com.xique.park.api.model.LoginParkMiniUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @program: xq-cloud
 * @ClassName RemoteParkWxLoginService
 * @description:
 * @author: HdongSun
 * @create: 2022-08-26 10:34
 **/
@FeignClient(contextId = "RemoteParkWxLoginService", value = ServiceNameConstants.PARK_BIZ_SERVICE, fallbackFactory = RemoteParkWxLoginFallbackFactory.class)
public interface RemoteParkWxLoginService {

    /**
     * 获取微信手机号
     *
     * @param code
     * @return com.xique.common.core.web.domain.AjaxResult
     * @author shd
     * @date 2022/4/14 13:44
     */
    @GetMapping("login/getPhone")
    R<String> getPhone(@RequestParam("code") String code);

    /**
     * 微信登录
     *
     * @param phone
     * @param code
     * @return com.xique.common.core.web.domain.AjaxResult
     * @author shd
     * @date 2022/4/14 15:38
     */
    @PostMapping("login")
    R<LoginParkMiniUser> login(@RequestParam("phone") String phone, @RequestParam("code") String code);

    /**
     * 获取支付宝手机号
     * @param jsonStr
     * @return
     */
    @GetMapping("login/getZfbPhone")
    R<String> getZfbPhone(@RequestParam("jsonStr") String jsonStr);

    /**
     * 支付宝登录
     * AppLoginBody
     * @return
     */
    @PostMapping("login/zfbLogin")
    R<LoginParkMiniUser> zfbLogin(@RequestBody AppLoginBodyDTO body);

    /**
     * 验证码登录
     *
     * @param phone
     * @param code
     * @return com.xique.common.core.web.domain.AjaxResult
     */
    @PostMapping("login/verificationCode")
    R<LoginParkMiniUser> verificationCode(@RequestParam("phone") String phone, @RequestParam("code") String code);

    /**
     * 短信验证码获取
     *
     * @param phone
     * @return com.xique.common.core.web.domain.AjaxResult
     */
    @GetMapping("login/sendSmsCode")
    R<String> sendAuthCode(@RequestParam("phone") String phone);
}
